from dataclasses import dataclass
from typing import List, Optional

@dataclass
class GongZhiHua:
    zi_group_idx: int
    zihua_name: str
    is_ben_gong: bool
    zihua_xing: str


@dataclass
class Star:
    # 这里可以定义 Star 类的具体字段
    pass


class Gong:
    def __init__(self):
        self._gong_dizhi: Optional[str] = None  # 只有 getter，初始化为 None
        self.gong_name: Optional[str] = None
        self.is_shengxiao_gong: bool = False
        self.is_shen_gong: bool = False
        self.is_laiyin_gong: bool = False
        self.gong_tian_gan: Optional[str] = None
        self.gong_ganzhi: Optional[str] = None
        self.time_range_type: Optional[str] = None
        self.time_range_name: Optional[str] = None
        self.gong_zi_hua: List[GongZhiHua] = []
        self.gong_zi_hua_txt: Optional[str] = None
        self.stars_list: List[Star] = []

    @property
    def GongDiZhi(self) -> Optional[str]:
        return self._gong_dizhi

    def set_GongDiZhi(self, value: str):
        # 模拟 private setter
        self._gong_dizhi = value

    # 静态方法：获取纯十二宫（只有地支）
    @staticmethod
    def GetPureShiErGong() -> List['Gong']:
        gongs = []
        dizhi = CommonVarRule.CONST_DIZHI  # 假设这个变量已定义

        for item in dizhi:
            gong = Gong()
            gong.set_GongDiZhi(item)
            gong.stars_list = []
            gongs.append(gong)

        return gongs


# 示例常量类（需根据实际实现补充内容）
class CommonVarRule:
    CONST_DIZHI = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"]